#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/Defines.h"

using namespace fxcc::yml;
using namespace fxcc::graph::common;


template<>
void Serializer::Encode<Defines::Pair>(YAML::Node& node, const Defines::Pair& inst)
{
	SetVariable<std::string>(node, "m_Key", inst.m_Key);
	SetVariable<std::string>(node, "m_Value", inst.m_Value);
}


template<>
bool Serializer::Decode<Defines::Pair>(const YAML::Node& node, Defines::Pair& inst)
{
	GetVariable<std::string>(node, "m_Key", inst.m_Key);
	GetVariable<std::string>(node, "m_Value", inst.m_Value);
	return true;
}

template<>
void Serializer::Encode<Defines>(YAML::Node& node, const Defines& inst)
{
	SetVariable<bool>(node, "m_HasSkinnedShader", inst.m_HasSkinnedShader);
	SetArrayVariable<Defines::Pair>(node, "m_Values", inst.m_Values);
}


template<>
bool Serializer::Decode<Defines>(const YAML::Node& node, Defines& inst)
{
	GetVariable<bool>(node, "m_HasSkinnedShader", inst.m_HasSkinnedShader);
	GetArrayVariable<Defines::Pair>(node, "m_Values", inst.m_Values);
	return true;
}
